# $Id: PKGBUILD 65718 2012-02-22 11:48:53Z andrea $
# Maintainer:
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Pierre Schmitz <pierre@archlinux.de>

pkgname=qtcurve-kde3
pkgver=1.8.5
pkgrel=3
arch=('i686' 'x86_64')
groups=('qtcurve')
license=('GPL')
pkgdesc='A configurable set of widget styles for KDE and Gtk'
url='http://www.kde-look.org/content/show.php?content=40492'
depends=('kdelibs3')
makedepends=('cmake' 'kdelibs')
source=("http://craigd.wikispaces.com/file/view/QtCurve-KDE3-${pkgver}.tar.bz2"
	'kdeglobals'
	'bypass-kde-config.patch')
md5sums=('d9cca99526079782f9fc7bd7ba432582'
         '05a6294c7f0e239e698e7e5224fc8e7f'
         'e1ab2c0995e412b2cbfe804fba75517e')

build() {
  . /etc/profile.d/qt3.sh
  . /etc/profile.d/kde3.sh

  cd ${srcdir}/QtCurve-KDE3-${pkgver}
  # Bypass KDE prefix detection by kde4-config, see:
  # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=541667
  patch -Np1 -i ${srcdir}/bypass-kde-config.patch

  cd ${srcdir}
  mkdir build
  cd build
  cmake ../QtCurve-KDE3-${pkgver} \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/opt/kde
  make
}

package() {
  cd $srcdir/build
  make DESTDIR=$pkgdir install

  # remove kcontrol plugins
  rm -f $pkgdir/opt/kde/lib/kde3/kstyle_qtcurve_config.*

  # set default theme
  install -D -m644 $srcdir/kdeglobals $pkgdir/opt/kde/share/config/kdeglobals
}
